#ifndef INDEX_MANAGER_H
#define INDEX_MANAGER_H

#include <string>
#include <sqlite3/sqlite3.h>
#include "inverted_index.h"

class IndexManager {
public:
    IndexManager();
    ~IndexManager();

    int LoadDB(std::string &db);
    int GetTokenID(std::string token);
    PostingList GetPosting(std::string &token);
    int WriteList(PostingList &lst);

private:
    std::string dbPath_;
    sqlite3 *db_;
    sqlite3_stmt *getTokenID_;
    sqlite3_stmt *getPosting_;
    sqlite3_stmt *insertPosting_;
    sqlite3_stmt *updatePosting_;
};

#endif
